﻿<Window x:Class="JobOffersBrowser.Views.AdvancedSearchWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AdvancedSearchWindow" Height="500" Width="900"
        ResizeMode="CanMinimize">
    <Grid>
        <StackPanel Orientation="Vertical" MaxHeight="500">
            <StackPanel>
                <StackPanel Orientation="Horizontal" Margin="5">
                    <TextBlock Text="ID: "/>
                    <TextBox Text="{Binding Id}" Width="100"/>
                    
                    <TextBlock Text="JobTitle: "/>
                    <TextBox Text="{Binding JobTitle}" Width="100"/>

                    <TextBlock Text="email: "/>
                    <TextBox Text="{Binding Email}" Width="100"/>

                    <TextBlock Text="Phone: "/>
                    <TextBox Text="{Binding Phone}" Width="100"/>
                    
                    <DatePicker SelectedDate="{Binding PublishDate}"/>
                </StackPanel>
                <StackPanel Margin="5" Orientation="Horizontal">
                    <TextBlock Text="Industry: "/>
                    <ComboBox MinWidth="100" ItemsSource="{Binding Industries}" SelectedItem="{Binding CurrentIndustry}" DisplayMemberPath="IndustryName"/>
                    <TextBlock Text="Company: "/>
                    <ComboBox MinWidth="100" ItemsSource="{Binding Companies}" SelectedItem="{Binding CurrentCompany}" DisplayMemberPath="Name"/>
                    <TextBlock Text="Status: "/>
                    <ComboBox MinWidth="100" ItemsSource="{Binding Statuses}" SelectedItem="{Binding CurrentStatus}" DisplayMemberPath="StatusName"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Country: "/>
                    <ComboBox MinWidth="100" ItemsSource="{Binding Countries}" SelectedItem="{Binding CurrentCountry}" DisplayMemberPath="CountryName"/>
                    <TextBlock Text="City: "/>
                    <ComboBox MinWidth="100" ItemsSource="{Binding Cities}" SelectedItem="{Binding CurrentTown}" DisplayMemberPath="CityName"/>
                </StackPanel>
                <Button Content="Search" Command="{Binding SearchCommand}" 
                        HorizontalAlignment="Left"  Width="100"
                        FontWeight="ExtraBold"></Button>
            </StackPanel>

            <DataGrid x:Name="DataGridOffers" ItemsSource="{Binding Offers}" AutoGenerateColumns="False" CanUserAddRows="False"
                      IsReadOnly="True" Margin="1" MaxHeight="350">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="ID" Binding="{Binding OfferID}"/>
                    <DataGridTextColumn Header="JobTitle" Binding="{Binding JobTitle}"/>
                    <DataGridTextColumn Header="Status" Binding="{Binding Status}"/>
                    <DataGridTextColumn Header="PublishDate" Binding="{Binding PublishDate}"/>
                    <DataGridTextColumn Header="DaysRemaining" Binding="{Binding ValidDaysRemaining}"/>
                    <DataGridTextColumn Header="Industry" Binding="{Binding Industry.IndustryName}"/>
                    <DataGridTextColumn Header="Company" Binding="{Binding Company.Name}"/>
                    <DataGridTextColumn Header="Country" Binding="{Binding Country}"/>
                    <DataGridTextColumn Header="City" Binding="{Binding City}"/>
                    <DataGridTextColumn Header="Description" Binding="{Binding JobDescription}"/>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </Grid>
</Window>
